#ifndef _SYSTEMCLASS_H_
#define _SYSTEMCLASS_H_

#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <Windowsx.h>

#include "InputManager.h"
#include "Timer.h"
#include "SoundTask.h"

#define INPUT_DELAY 120
#define FULL_SCREEN false

class Core : public sigslot::has_slots<>
{
public:
	Core();
	Core(const Core& other);
	~Core();

	bool init();
	void Shutdown();
	void Run();

	LRESULT CALLBACK MessageHandler(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM lparam);

private:

	bool done;
	Timer t;

	bool frame(double delta);
	void initWindows(int& width, int& height);
	void ShutdownWindows();

	void keyDown(const InputEvent& e);

	LPCWSTR m_applicationName;
	HINSTANCE m_hinstance;
	HWND m_hwnd;

	InputManager* m_Input;
	SoundTask* soundTask;
};

static LRESULT CALLBACK WndProc(HWND hwnd, UINT umessage, WPARAM wparam, LPARAM lparam);
static Core* ApplicationHandle = 0;

#endif